package fr.oz.core.fonts 
{
	import flash.text.Font;
	import flash.text.TextField;
	/**
	 * ...
	 * @author Fazermokeur
	 */
	public class GetFonts
	{
		//--------------------------------------------------------------------------
		//
		//  Private static vars
		//
		//--------------------------------------------------------------------------
		static private var fontName:Object = { };
		static private var fontStyle:Object = { };
		static private var fontType:Object = { };
		
		
		//--------------------------------------------------------------------------
		//
		//  Constructor
		//
		//--------------------------------------------------------------------------
		public function GetFonts() { }
		
		
		//--------------------------------------------------------------------------
		//
		//  Public static methods
		//
		//--------------------------------------------------------------------------
		public static function buildFonts(font:Font):void
		{
			GetFonts.fontName[font.fontName] = font.fontName;
			GetFonts.fontStyle[font.fontName] = font.fontStyle;
			GetFonts.fontType[font.fontName] = font.fontType;
			
			trace("0: "+font.fontName + " " + font.fontStyle + " " +font.fontType);
		}
		
		public static function getFont(id:String):FontsData
		{
			var datas:FontsData = new FontsData();
			datas.fontName = GetFonts.fontName != null ? GetFonts.fontName[id] : "Arial";
			datas.fontStyle = GetFonts.fontStyle != null ? GetFonts.fontStyle[id] : "regular";
			datas.fontType = GetFonts.fontType != null ? GetFonts.fontType[id] : "embedded";
			
			return datas;
        }
		
	}

}